<span class="upload-video">
    <script type="text/javascript">
        $(function(){
	        $('.upload-video').on('blur', '.ivideo > textarea', function(e){
		        if($(this).val() == '')
			        return false;

		        var temp = $('.upload-video .ivideo.template').clone(true);

		        temp.removeClass('template').find('textarea').attr('disabled', false);

		        $(this).parent().after(temp);
	        });

	        $('.upload-video .ivideo').on('click', 'a', function(e){
		        e.preventDefault();
		        var cont = $(this).parent();
		        $.getJSON($(this).attr('href'), {}, function(response){
			        if(response)
			        {
				        cont.remove();
			        }
		        });
	        });
        });
    </script>

    <style>

    </style>

    <span class="ivideo template">
        <textarea class="i-textarea" disabled name="videos[]" placeholder="Video code"></textarea>
    </span>

	<span class="ivideo">
        <textarea class="i-textarea" name="videos[]" placeholder="Video code"></textarea>
    </span>

    <span class="videos"><?php

        if(!empty($oRow) && !empty($oRow['videos']))
        {
            foreach($oRow['videos'] as $oVideo)
            {
        ?>
        <span class="ivideo">
            <a href="<?php echo Yii::app()->controller->createUrl('/general/deleteVideo/', array('id' => $oVideo->id)); ?>"></a>
	        <span class="video-wrapper"><?php echo $oVideo->code; ?></span>
        </span>
        <?php
            }
        }

    ?></span>
</span>